package com.hxd.mall.module.usercenter.bindorder

import android.graphics.Color
import android.text.TextUtils
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.hxd.mall.R
import com.hxd.mall.base.BaseInjectActivity
import com.hxd.mall.constant.HxdConstantsRouterPath.PathUserCenter.path_user_center_bindorder_order
import com.hxd.mall.module.usercenter.bindorder.bean.BindResultBean
import com.hxd.mall.utils.local.NavigationUtil
import com.hxd.mall.utils.local.StackManageUtil
import com.hxd.mall.utils.open.ToastUtil
import com.hxd.mall.utils.open.addSetOnClickListener
import crossoverone.statuslib.StatusUtil
import kotlinx.android.synthetic.main.activity_bind.*

@Route(path = path_user_center_bindorder_order)
class BindOrderActivity : BaseInjectActivity<IBindPresenter>(), IBindView {

    override fun attachLayoutRes(): Int = R.layout.activity_bind

    override fun initViews() {

        setTitleCommon("订单绑定")
        addSetOnClickListener(order_commit) {
            OnClick(order_commit)
        }
    }

    override fun setStatusColor() {
        StatusUtil.setUseStatusBarColor(this, Color.WHITE)
    }

    override fun setSystemInvadeBlack() {
        StatusUtil.setSystemStatus(this, false, true)
    }

    //点击事件
    private fun OnClick(v: View) {
        if (TextUtils.isEmpty(order_num.text.toString())) {
            ToastUtil.showToast("请输入订单号")
            return
        }
        mPresenter?.bindOrder(order_num.text.toString())
    }

    override fun initData() {
    }

    override fun getResult(t: BindResultBean) {

    }

}
